package com.linkhub.oms.admin.modules.system.domain.param;

import cn.hutool.core.lang.RegexPool;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @Description: SystemSignUpParam
 * @Author: echo
 * @Date: 2024/3/6 15:23
 * @Version: 1.0
 */
@Data
@ApiModel("SystemSignUpParam")
public class SystemSignUpParam implements Serializable {

    @ApiModelProperty(value = "邮箱", required = true)
    @Pattern(regexp = RegexPool.EMAIL, message = "{validation.email.pattern}")
    private String email;

    @ApiModelProperty(value = "验证码", required = true)
    @NotBlank(message = "{validation.code.notBlank}")
    private String code;

    @ApiModelProperty(value = "密码（6+位，需数字/字母/特殊字符组合，不含空格）", required = true)
    @NotBlank(message = "{validation.password.notBlank}")
    @Size(min = 6, message = "{validation.password.size}")
    @Pattern(
            regexp = "^(?!.*\\s)((?=.*[a-zA-Z])(?=.*\\d)|(?=.*[a-zA-Z])(?=.*[\\W_])|(?=.*\\d)(?=.*[\\W_]))\\S+$",
            message = "{validation.password.pattern}"
    )
    private String password;

    @ApiModelProperty(value = "确认密码", required = true)
    @NotBlank(message = "{validation.confirmPassword.notBlank}")
    private String confirmPassword;

    @ApiModelProperty(value = "用户名，注册必填")
    @Size(max = 50, message = "{validation.userName.size}")
    private String userName;

    @ApiModelProperty(value = "国家数字码（如中国86），注册必填")
    private String countryDigitalCode;

    @ApiModelProperty(value = "手机号码（不含国家码），注册必填")
    private String phone;
}
